<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        html,body{
              margin: 0;
              padding: 0;
        }
    .content{
        width:1200px;
        height: 500px;
        border: 1px solid black
    }
    </style>
</head>
<body>
    <div class="content"></div>
    <div class="content"></div>
    <div class="content"></div>
    <div class="content"></div>
    <div class="content"></div>
    <div class="content"></div>
    <div class="content"></div>
    <div class="content"></div>
    <div class="content"></div>
    <script>
        var scroll_result=document.documentElement.scrollHeight||document.body.scrollHeight;
        var client_result=document.documentElement.clientHeight||document.body.clientHeights;
        var result=scroll_result-client_result;
        console.log(result)
        window.onscroll=function (){
            var scroll=document.documentElement.scrollTop||document.body.scrollTop;
            if(scroll>=result-3){
            console.log("到达底部")
            }
        }
    </script>
</body>
</html>